﻿using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;

public class Result : MonoBehaviour
{

    //public PlayControl playControl = new PlayControl();
    //Rigidbody rig;
    void Start()
    {
 
    }

    void Update()
    {

    }
    void OnGUI()
    {
        //PlayControl playControl = GameObject.Find("Cube").GetComponent<PlayControl>();
        //GameObject.Find("Cube").GetComponent<MeshRenderer>().enabled = false;//使用它可以将物体渲染到屏幕上，那么如果禁用了这一组件的话，自然也就实现了物体的隐藏。
        //GameObject.Find("Cube").GetComponent<Rigidbody>().useGravity = false;
        GUI.Label(new Rect((Screen.width - 100) / 2, (Screen.height - 45) / 2 + 30, 100, 45), "最后吃金币数是" + PlayerPrefs.GetInt("num"));
        GUI.Label(new Rect((Screen.width - 140) / 2, (Screen.height - 45) / 2 + 45, 140, 45), "最后吃加速道具数" + PlayerPrefs.GetInt("num2"));
        GUI.Label(new Rect((Screen.width - 100) / 2, (Screen.height - 45) / 2 + 60, 100, 45), "最后吃护身罩数" + PlayerPrefs.GetInt("num3"));
        GUI.Label(new Rect((Screen.width - 100) / 2, (Screen.height - 45) / 2 + 75, 100, 45), "最后分数是" + PlayerPrefs.GetInt("score"));
        if (GUI.Button(new Rect(0, Screen.height - 100, 100, 100), "返回关卡"))
        {
            //切换场景
           //Application.LoadLevel("guanka");
            SceneManager.LoadScene("guanka");
                       
        }
    }
 
}
